<?php
class test1{
    public $a='我是被测试者';
}
class test{
     public $b;
     function __construct($a)
     {
         $this->b=$a;
     }
     public function update(){
        return $this->b->a;
     }
}
 $a=new test1();
 $b=new test($a);
echo $b->update();
